const mongoose = require('mongoose');
const Schema = mongoose.Schema;

let orderSchema = new Schema({
  orderId: String,
  status: {
    type: Number, // 0: 表示未支付, 1: 表示已支付
    default: 0
  },
  expireTime: {
    type: Date,
    default: Date.now()
  },
  userId: String,
  payMethod: {
    type: String,
    default: ''
  },
  price: Number,
  username: String,
  films: [
    {
      doubanId: String,
      original_title: String,
      coverurl: String,
      poster: String,
      collect_count: Number,
      wish_count: Number,
      genres: [String],
      price: Number
    }
  ]
}, {versionKey: false, timestamps: true});
module.exports = mongoose.model('order', orderSchema)
;
